<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <!-- <header-detail :seller="seller"></header-detail> -->
    <div class="tab-wrapper">
      <v-tab :tabs="tabs"></v-tab>
    </div>
  </div>
</template>

<script>
import VHeader from "components/v-header/v-header";
// import HeaderDetail from "components/header-detail/header-detail";
import Goods from "components/goods/goods";
import Ratings from "components/ratings/ratings";
import Seller from "components/seller/seller";
import VTab from "components/tab/tab";
import { getSeller } from "@/api/index";

export default {
  components: {
    VHeader,
    VTab
    // HeaderDetail
  },
  data() {
    return {
      seller: {},
      goods: []
    };
  },
  computed: {
    tabs() {
      return [
        {
          label: "商品",
          component: Goods,
          data: { seller: this.seller }
        },
        {
          label: "评价",
          component: Ratings,
          data: { seller: this.seller }
        },
        {
          label: "商家",
          component: Seller,
          data: { seller: this.seller }
        }
      ];
    }
  },

  created() {
    this._getSeller();
  },
  methods: {
    // 获取商家信息
    _getSeller() {
      getSeller().then(seller => {
        this.seller = seller;
      });
    }
  }
};
</script>
<style lang="stylus">
@import 'common/stylus/index.styl';
.tab-wrapper {
  position fixed
  left 0
  right 0
  bottom 0px
  top 137px
}
</style>
